<!--
 * @Author: Freude Xu
 * @Date: 2021-10-05 17:46:26
 * @LastEditors: Freude Xu
 * @LastEditTime: 2021-10-05 17:51:41
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            height: 1000px;
        }
    </style>
</head>

<body>

</body>
<script>
    document.addEventListener('click', function(e) {
        //鼠标事件：相对于可视窗口的X和Y轴坐标
        console.log(e.clientX);
        console.log(e.clientY);
        console.log('-----------------------');

        //鼠标事件：相对于页面的x和y的坐标
        console.log(e.pageX);
        console.log(e.pageY);
        console.log('-----------------------');

        //鼠标事件：相对于电脑屏幕的x和y的坐标（当浏览器窗口缩小时，点击显示的是距离电脑屏幕的x和y）
        console.log(e.screenX);
        console.log(e.screenY);
    })
</script>

</html>